<script setup>
import {ref} from "vue";
import {getusermassage} from "@/api/article";
import useUserInfoStore from "@/sts/userinfo";
import {GetBeAdd} from "@/api/beadd";

const userinfo=useUserInfoStore();
//用户信息
const user=ref({
  id:0,
  name:'',
  username:'',
  introduce:'',
  occupationId:'',
  jurisdiction:'',
  occName:''
})
//关注信息
const beadd=ref([{
  username:'',
  userId:'',
  resourcesId:'',
  resourcesName:'',
  updateTime:''
}])
//获取用户信息
const usermassage=async ()=>{
  let result=await getusermassage(userinfo.info);
  user.value=result.data;
  await GetBeAddService();
}
usermassage();
//获取所有添加了该用户资源的列表
const GetBeAddService=async ()=>{
  let result=await GetBeAdd(user.value.id);
  beadd.value=result.data;
}

</script>

<template>
  <el-card class="box-card">
    <el-table :data="beadd" border style="width: 100%">
      <el-table-column prop="username" label="用户名"/>
      <el-table-column prop="resourcesName" label="被添加的资源名称"/>
      <el-table-column prop="updateTime" label="添加时间" />
    </el-table>
  </el-card>
</template>


<style scoped>
.box-card {
  transform: translateY(60px);
  margin-right: 100px;
  height: 600px;
}
</style>